import { createRouter, createWebHistory } from 'vue-router'
import MainLayout from '../components/main.vue'
import Navbar from '../components/navbar.vue'
import DongtaiHeader from '../components/header/dongtai.vue'
import JingxuanHeader from '../components/header/jingxuan.vue'
import ShezhiHeader from '../components/header/shezhi.vue'
import ShouyeHeader from '../components/header/shouye.vue'
import WodeHeader from '../components/header/wode.vue'
import Remen from '../components/main/shouye/remen.vue'
import Tuijian from '../components/main/shouye/tuijian.vue'
import Yingshi from '../components/main/shouye/yingshi.vue'
import Zhibo from '../components/main/shouye/zhibo.vue'
import Zhuifan from '../components/main/shouye/zhuifan.vue'
import Zonghe from '../components/main/dongtai/zonghe.vue'
import Shezhi from '../components/main/shezhi/shezhi.vue'
import Shiping from '../components/main/dongtai/shiping.vue'
import Jingxuan from '../components/main/jingxuan/index.vue'
import Wode from '../components/main/wode/index.vue'
const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: '/',
      components: {
        default: Navbar,
        layout: MainLayout
      },
      children: [
        // 首页（带标签页）
        {
          path: 'shouye',
          components: {
            header: ShouyeHeader,
            main: Tuijian
          },
          children: [
            { path: 'remen', component: Remen, name: 'ShouyeRemen' },
            { path: 'tuijian', component: Tuijian, name: 'ShouyeTuijian' },
            { path: 'yingshi', component: Yingshi, name: 'ShouyeYingshi' },
            { path: 'zhibo', component: Zhibo, name: 'ShouyeZhibo' },
            { path: 'zhuifan', component: Zhuifan, name: 'ShouyeZhuifan' },
            { path: '', redirect: { name: 'ShouyeTuijian' } }
          ]
        },
        // 精选（带标签页，示例）
        {
          path: 'jingxuan',
          components: {
            header: JingxuanHeader,
            main: Jingxuan
          },
          children: [
            { path: 'index', component: Jingxuan, name: 'JingxuanJingxuan' },
            { path: '', redirect: { name: 'JingxuanJingxuan' } }
          ]
        },
        // 动态（带标签页）
        {
          path: 'dongtai',
          components: {
            header: DongtaiHeader,
            main: Zonghe
          },
          children: [
            { path: 'zonghe', component: Zonghe, name: 'DongtaiZonghe' },
            { path: 'shiping', component: Shiping, name: 'DongtaiShiping' },
            { path: '', redirect: { name: 'DongtaiZonghe' } }
          ]
        },
        // 我的（带标签页）
        {
          path: 'wode',
          components: {
            header: WodeHeader,
            main: Wode
          },
          children: [
            { path: 'index', component: Wode, name: 'WodeWode' },
            { path: '', redirect: { name: 'WodeWode' } }
          ]
        },
        // 设置（带标签页，示例）
        {
          path: 'shezhi',
          components: {
            header: ShezhiHeader,
            main: Shezhi
          },
          children: [
            { path: 'shezhi', component: Shezhi, name: 'ShezhiShezhi' },
            { path: '', redirect: { name: 'ShezhiShezhi' } }
          ]
        },
        { path: '', redirect: { path: '/shouye' } }
      ]
    }
  ]
})

export default router
